import java.util.Scanner;
import java.util.Objects;
public class demo4 {
    public static  void main(String[]args){
        System.out.println("请输入用户名");
        Scanner input =new Scanner(System.in);
        String name = input.next();
        for(int i =0;i<2;i++){
            System.out.println("请输入密码（密码可包含字母和汉字）");
            String password1 =input.next();
            System.out.println("请再次输入密码");
            String password2 =input.next();
            if(Objects.equals(password1, password2)){
                System.out.println("恭喜注册成功");
                break;
            }
            else{
                System.out.println("对不起，您两次输入的密码不一致，请重新输入");
                continue;
            }
        }
    }
}
